This section is all about definitions and can be read quickly and then put aside until needed. Indeed, skipping over it is recommended.
An interval is a sequence of defined number types that proceeds orderly from a beginning to an end. An open interval does not include its beginning and end points and is indicated by parenthesis. For example, the interval $0 < x < 5\quad x\in\mathbb{R}$ can be indicated as $x\in R$ such that $x=(0,5)$. A closed interval does include its endpoints and is indicated by square brackets. $$x\in R\;:\;0\le x\le5\rightarrow x=[0,5]$$ A way to remember the notation is that the bracket, having an obvious corner point, means to include the corner or end points, while a parenthesis excludes the same. Some authors use brackets turned the wrong way, $]0,5[,$ for the closed interval symbol. Mixing symbols, $[a,b)$ means the interval is closed on the $a$ end and open on the $b$ end.
A relation is a set of ordered pairs and usually we mean ordered pairs of numbers. By the word ordered, we mean that the set of pair values must not be rearranged. The “ordering” permits making a graph of the relation. An example of a relation is the following. $$\left\{ (-1,3),(0,6),(1,5),(2,4),(3,8),(4,16)\right\} $$ Within each tuple, we could let the first element be the $x$ coordinate and the second element be the $y$ coordinate and then construct a graph of the relation. Most often, the ordering is such that the $x$ value in the tuple continuously increases, but that is not a requirement. The following relation does not follow the increasing $x$ pattern. Indeed the two $x$ values are the same and there are two different $y$ values. Still, it is a relation. If we were to swap the pairs, it would be a different relation. The “ordering” is of the pairs. $$\left\{ (0.5,\,0.87),(0.5,\,-0.87)\right\}$$ A function is a relation for which each $x$ value is uniquely related to one and only one $y$ value. The $x$ values are called the domain of the function. [Usually, the domain is graphed on the $x$ axis.] The $y$ values come from the codomain. The range is a subset of the codomain (which of course could be all of it) and is the set of all possible outputs. The codomain, for example, might include all of $\mathbb{R}$ but the function might restrict the output to some subset of $\mathbb{R}$ and that subset is the range. “Range” is used, including in this text, but for careful writing one might best define it in context.
Maths uses the word range for two different ideas. The “range of a function” is a set containing all possible output values. So for example $f:\mathbb{R\rightarrow R}\{x\in f:f(x)=x^{2}\}.$ Here the domain and codomain are the set of real numbers, but the range is the set of real numbers in the interval $[0,\infty).$ Maths also uses the word range to mean any defined interval between two numbers in a set. These two uses will not produce confusion in most cases.
The actual output of a function for some argument should be called an image. The image could be a single number, but it could also be the output of the function across some interval. That is, the input to a function is a subset of the domain and the output on that particular subset is the image.
The input value to a function is called its argument. Some functions have more than one argument. From the perspective of the image, the argument is the pre-image of the output.
Answer: The domain and codomain are each stated to be the set of real numbers, i.e. $\mathbb{R\rightarrow\mathbb{R}}$. To compute an image at $x=3$, we evaluate the function. $f(3)=3\cdot3=9$. Another way to say this is that $9$ is the image of $3$ under $f$. The pre-image of $21$ is the argument that must be given to $f$ in order to get the image, $21$. That is, the pre-image of $21$ is $7$.
$f\;:\;A\rightarrow B$ means that $f\,$ is a function which maps elements in the set $A$ to elements in the set $B.$ The domain of $f\,$ is $A$ and the codomain of $f\,$ is $B$. For example, $f\;:\;\mathbb{R}\rightarrow\mathbb{R}_{+} \{x\in f:x\mapsto x^2\}$. The symbol $\mapsto$ is read as “maps to”. It is very obvious when one begins using latex since “\mapsto” is the latex code for that symbol. These statements say that $f$ is a function such that the domain is the real numbers and the codomain is the positive real numbers, $\mathbb{R}_+.$ The function is not bijective (see definition below) and we cannot uniquely determine the input from the output. (i.e. for output $x^{2}$, $f(x)=\pm\sqrt{x^{2}}$) In order to get a bijective function in this instance, we need, $f\;:\;\mathbb{R}_{+}\rightarrow\mathbb{R}_{+}\quad x\mapsto x^{2}$. With this domain restriction, we can be sure that $f(x)$ is a positive number.
We use the arrow symbol $\rightarrow$ for “implies”, although many authors use $\Longrightarrow$ for “implies”. However, in the expression, $f:\;X\rightarrow Y,$ we mean that the function $f\;$ maps the domain $X$ into the codomain $Y.$ Our definition for a function says that all $x$ values map to a unique $y$ value. Clearly, one-to-one satisfies that definition. However, it is also satisfied by many-to-one. Conversely, if a single $x$ value maps to more than one $y$ value then the relation is not a function. Many conic sections, which have valid equations, are not functions by this definition.
An example of a one-to-one function is a non-vertical straight line. For every $x\in \mathbb{R}$ there is one and only one $y\in\mathbb{R}$. However, consider the polynomial function shown in figure Functions:Yes and No. It is a many-to-one. The horizontal line at $y=1$ crosses the function at least $5$ times, for $5$ different values of $x$. Next to the polynomial function in the figure is an ellipse. An ellipse in not a function. It has a one-to-many relation.
A general function $f\,:\,A\rightarrow B$ accepts any member of set $A$ and makes output inside of set $B$, but it does not have to use all members of set $B$ and most of the time, the image of the function is a very limited subset of $B$.